-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@angular/cli): schematics commands should fail on unknown options #13480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(@angular/cli): schematics commands should fail on unknown options #13480
Conversation
When an addition argument is parsed the schematic commands should fail with an error. Fixes #12549
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this has the potential to cause unintentional failures for existing users, targeting 8.0 may be the safer option.
caretaker: this is for version 8 |
@@ -437,6 +437,15 @@ export abstract class SchematicCommand< | |||
args = await this.parseArguments(schematicOptions || [], o); | |||
} | |||
|
|||
// ng-add is special because we don't know all possible options at this point | |||
if (args['--'] && schematicName !== 'ng-add') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing schematicName == ng-add
why not use a this.validateAdditionalArgs()
or maybe a allowAdditionalArgs
getter that is false for the base command class, true for add?
People can still ng generate something:ng-add
and it would trigger this condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will follow up on this as I like the idea.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When an addition argument is parsed the schematic commands should fail with an error.
Fixes #12549